package com.haixiaoke.flat.banner.controller;

import com.haixiaoke.saas.banner.domain.Banner;
import com.haixiaoke.saas.banner.service.IBannerService;
import com.haixiaoke.saas.common.core.domain.AjaxResult;
import com.haixiaoke.saas.system.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 广告信息Controller
 *
 * @author xiaolong
 * @date 2025-05-08
 */
@RestController
@RequestMapping("/front/flat/banner/banner")
public class FlatBannerController extends BaseController {
    @Autowired
    private IBannerService bannerService;

    /**
     * 查询广告信息
     */
    @GetMapping("/list")
    public AjaxResult list(Banner banner) {
        return success(bannerService.selectBannerList(banner));
    }

    /**
     * 获取广告信息详细信息
     */
    @GetMapping(value = "/{bannerId}")
    public AjaxResult getInfo(@PathVariable("bannerId") Long bannerId) {
        return success(bannerService.selectBannerByBannerId(bannerId));
    }

}
